# Contributor: Andrej Kolchin <KAAtheWise@protonmail.com>
# Contributor: fossdd <fossdd@pwned.life>
# Maintainer: fossdd <fossdd@pwned.life>
pkgname=vale
pkgver=3.8.0
pkgrel=0
pkgdesc="A markup-aware linter for prose built with speed and extensibility in mind"
url="https://vale.sh/"
arch="all"
license="MIT"
makedepends="go"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/errata-ai/vale/archive/v$pkgver.tar.gz"
options="net"

export GOCACHE="${GOCACHE:-"$srcdir/go-cache"}"
export GOTMPDIR="${GOTMPDIR:-"$srcdir"}"
export GOMODCACHE="${GOMODCACHE:-"$srcdir/go"}"
export GOFLAGS="$GOFLAGS -modcacherw"

build() {
	go build -ldflags "-X main.version=v$pkgver" -o bin/vale ./cmd/vale
}

check() {
	go test ./...
}

package() {
	install -Dm755 bin/vale -t "$pkgdir"/usr/bin
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}

sha512sums="
58aaff49c84945f9dff41e57bc86b7c8e273b7a859cdcbc45eed21092686f8be8df0cf659bf0f8332c5ab134c1cb76d6bcf155194c0a136517bec864a60eb441  vale-3.8.0.tar.gz
"
